﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nuzzle.Protocol.Messages.Game.Context.Roleplay
{
    public class MapComplementaryInformationsDataMessage : NetworkMessage
    {
        public MapComplementaryInformationsDataMessage(short subareaID, int mapID, byte subareaAlignmentSide,
            List<Types.Game.Context.Roleplay.GameRolePlayCharacterInformations> Characters)
            : base(NetworkMessageID.MapComplementaryInformationsDataMessage)
        {
            base.WriterBuffer.writeShort(subareaID);
            base.WriterBuffer.writeInt(mapID);
            base.WriterBuffer.writeByte(subareaAlignmentSide);

            base.WriterBuffer.writeShort(0);//Houses

            base.WriterBuffer.writeShort((short)Characters.Count);//Actors
            foreach (var character in Characters)
            {
                base.WriterBuffer.writeShort(36);
                character.Serialize(this);
            }

            base.WriterBuffer.writeShort(0);//InteractiveElement

            base.WriterBuffer.writeShort(0);//StatedElements

            base.WriterBuffer.writeShort(0);//Obstacle

            base.WriterBuffer.writeShort(0);//Fights
        }
    }
}
